﻿<?php require_once("includes/session.php"); ?>
<?php confirm_logged_in(); ?>
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php include("includes/header.php"); ?>

<?php
//FOTO
$foto_path = "images/cerberus.jpg";

	$sql = "SELECT * ";
	$sql .= " FROM `vartotojas`,`personalas`,`personalopareigos`,`skyrius` ";
	$sql .= " WHERE `vartotojas`.vartotojasid = ";
	$sql .= $_SESSION['vartotojasid'];
	$sql .= " AND `vartotojas`.`personalasid`=`personalas`.`personalasid`";
	$sql .= " AND `personalas`.`personalopareigosid`=`personalopareigos`.`personalopareigosid`";
	$sql .= " AND `personalas`.`skyriusid`=`skyrius`.`skyriusid`";

	$sql .= " LIMIT 1";
	
	$result = mysql_query($sql, $connection);
	$vart = mysql_fetch_assoc($result);
?>
			
<article>
	<h2><?php 
	if ($edit) { echo "Esamo vartotojo redagavimas";} 
	else { echo "Naujo vartotojo ivedimas";};
	?></h2>
	
	<p>Pagrindiniai duomenys</p>
	<br>
	<?php echo $message;
		
	?>
<table width="730" border="0" cellspacing="2" cellpadding="3">	

  <tr>
    <td width="99">Vardas:</td>
    <td width="129"><strong><?php echo $vart['vardas'];?></strong></td>
    <td width="100"></td>
    <td width="71">&nbsp;</td>
    <td width="289" rowspan="12" align="center"><img src="<?php echo $foto_path;?>" alt="" width="200"  />&nbsp;</td>
</tr>
  <tr>  
    <td>Pavardė:</td>
    <td><strong><?php echo $vart['pavarde'];?></strong></td>
    <td></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>Pareigos:</td>
    <td><strong><?php echo $vart['personalopareigos'];?></strong></td>
    <td></td>
    <td>&nbsp;</td>
    </tr>
<tr>
    <td>Skyrius:</td>
    <td><strong><?php echo $vart['skyrius'];?></strong></td>
    <td></td>
    <td>&nbsp;</td>
    </tr>
<tr>
    <td>&nbsp;</td>
    <td><a href="change_pass.php">Keisti slaptažodį</a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
</table>
</article>

<?php require("includes/footer.php"); ?>